#!/bin/bash
function summa (){ summa=$(echo "${mat[@]/%/+}" | sed 's/+$//' | bc); echo 'summa='$summa ;}; mat=({999..1}); summa mat
